home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 1 Issue 2 / PDCD-1 - Issue 02.iso / _utilities / utilities / 004 / _tiger / !Tiger / !PtrCopy / !Help next >
Text File  |  1991-05-14  |  3KB  |  95 lines

  1.  
  2.  This software is (C) 1990 by Ran Mokady. It has been placed in the public
  3. domain, and may be copied used and distributed freely, as long as it is
  4. distributed complete with this documentation file, and with the copyright
  5. message intact.
  6.  
  7.  
  8.  The PtrUtils module provides SWI calls to read the (System font) character
  9. at a given position on the screen, and to read the character under the
  10. pointer. A task which seemed trivial at first but proved to be quite
  11. challenging to implement. It is able to recognize the character from one
  12. pixel ! (I.E. it'll recognize the character even if all of it but one pixel
  13. is hidden under another window !)
  14.  
  15.  This application demonstrates one possible use of this module.
  16.  It provides the equivalent of cursor copying under the desktop.
  17.  
  18.  To use the application:
  19.  
  20.              1. Double click on !PtrCopy. (Nothing happens)
  21.  
  22.              2. You can now move the mouse pointer over any system font
  23.                 character on the screen and press the CTRL and ALT keys to
  24.                 copy the character to the current input focus.
  25.  
  26.                 To copy a string just move the pointer over the first
  27.                 character, press CTRL-ALT, and then while holding CTRL-ALT
  28.                 down move the pointer over the string you want to copy. For
  29.                 people like me who can't move the pointer in a straight line
  30.                 to save their lives the mouse is bounded to a horizontal
  31.                 line while the CTRL & ALT keys are held down.
  32.  
  33. --------------------------------------------------------------------------------
  34.  
  35. For those of you interested in the SWI calls they are:
  36.  
  37.  
  38. SWI Pointer_GetCharacter  (&424c0)
  39.  Entry: 
  40.        r0 - Requesting task's handle.
  41.        r1 - X position on screen (in OS units). 
  42.        r2 - Y position on screen (in OS units). 
  43.  Exit: 
  44.        Registers preserved. 
  45.  
  46.        The task is later sent a Message_CharacterIs with the character      
  47. value, or 0 if there is no character at the given position. 
  48.  
  49. Errors: Pointer module in use : 
  50.  
  51.        This call can only be made by one task at a time, it should never be
  52. called from the redraw code of the calling task, otherwise you stand a good
  53. chance of getting this error !  
  54.  
  55.  
  56. SWI Pointer_GetCharacterAtPointer (&424c1)
  57.  
  58.  This is the same as GetCharacter only the position is implied by the 
  59. current WIMP pointer position. 
  60.  
  61.   Entry:      r0 - Requesting task's handle.
  62.  
  63.   Exit: 
  64.               r0 - Preserved. 
  65.               r1 - Current pointer X position. (As returned from
  66.                    Wimp_GetPointerInfo)
  67.               r2 - Current pointer Y position. (As returned from
  68.                    Wimp_GetPointerInfo)
  69.  
  70.   The task is later sent a Message_CharacterIs with the character       
  71. value, or 0 if there is no character at that position.
  72.  
  73. Errors:  Pointer module in use : 
  74.  
  75.    This call can only be made by one task at a time, it should never be
  76. called from the redraw code of the calling task, otherwise you stand a good
  77. chance of getting this error ! 
  78.  
  79.  
  80. Message_CharacterIs (&424c0) 
  81.  
  82.         +20 : ASCII code (or 0 if no character at the requested position)
  83.         +24 : X position of the left most pixel in the character on the
  84.               screen (in OS units).
  85.  
  86.  
  87. Any bugs found, or suggestions for improvements are gratefully accepted to
  88. Me at RMokady@Acorn.co.uk
  89.  
  90.                Ran.
  91.  
  92.  
  93.  
  94.  
  95.